package com.circle.model.module.log;

public class LoggerBuilder {

    private static LoggerABC singlenLogger;

    public static LoggerABC build(){
        if (null != singlenLogger){
            return singlenLogger;
        }
        LoggerABC errLogger = new ErrorLogger(LoggerABC.ERROR);
        LoggerABC warnLogger = new WarnLogger(LoggerABC.WARN);
        LoggerABC debugLogger = new DebugLogger(LoggerABC.DEBUG);
        LoggerABC infoLogger = new InfoLogger(LoggerABC.INFO);

        errLogger.setNextLoggerABC(warnLogger);
        warnLogger.setNextLoggerABC(debugLogger);
        debugLogger.setNextLoggerABC(infoLogger);
        singlenLogger = errLogger;
        return errLogger;
    }
}
